import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '委托单编号',
  //   align: "center",
  //   dataIndex: 'checkRef'
  // },
  {
    title: '送检日期',
    align: "center",
    dataIndex: 'checkDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '送检人',
    align: "center",
    dataIndex: 'checkPer'
  },
  // {
  //   title: '部门',
  //   align: "center",
  //   dataIndex: 'department'
  // },
  // {
  //   title: '委托附件',
  //   align: "center",
  //   dataIndex: 'annex',
  //   slots: { customRender: 'fileSlot' },
  // },
  {
    title: '委托单状态',
    align: "center",
    dataIndex: 'checkState'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "委托单编号",
    field: 'checkRef',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "送检日期",
    field: "checkDate",
    component: 'RangePicker',
    colProps: {span: 6},
  },
  {
    label: "送检人",
    field: 'checkPer',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "部门",
    field: 'department',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '委托单编号',
    field: 'checkRef',
    component: 'Input',
  },
  {
    label: '送检日期',
    field: 'checkDate',
    component: 'DatePicker',
  },
  {
    label: '送检人',
    field: 'checkPer',
    component: 'Input',
  },
  {
    label: '部门',
    field: 'department',
    component: 'Input',
  },
  {
    label: '委托附件',
    field: 'annex',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '委托单状态',
    field: 'checkState',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
